Optimal. Leaf size=126 \[ -\frac {2 (e+f x) \tanh ^{-1}\left (e^{c+d x}\right )}{a d}+\frac {2 i f \log \left (\cosh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )\right )}{a d^2}-\frac {f \text {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}+\frac {f \text {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}-\frac {i (e+f x) \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 7, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {5694, 4267,
2317, 2438, 3399, 4269, 3556} \begin {gather*} -\frac {f \text {Li}_2\left (-e^{c+d x}\right )}{a d^2}+\frac {f \text {Li}_2\left (e^{c+d x}\right )}{a d^2}+\frac {2 i f \log \left (\cosh \left (\frac {c}{2}+\frac {d x}{2}+\frac {i \pi }{4}\right )\right )}{a d^2}-\frac {2 (e+f x) \tanh ^{-1}\left (e^{c+d x}\right )}{a d}-\frac {i (e+f x) \tanh \left (\frac {c}{2}+\frac {d x}{2}+\frac {i \pi }{4}\right )}{a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2317
Rule 2438
Rule 3399
Rule 3556
Rule 4267
Rule 4269
Rule 5694
Rubi steps
\begin {align*} \int \frac {(e+f x) \text {csch}(c+d x)}{a+i a \sinh (c+d x)} \, dx &=-\left (i \int \frac {e+f x}{a+i a \sinh (c+d x)} \, dx\right )+\frac {\int (e+f x) \text {csch}(c+d x) \, dx}{a}\\ &=-\frac {2 (e+f x) \tanh ^{-1}\left (e^{c+d x}\right )}{a d}-\frac {i \int (e+f x) \csc ^2\left (\frac {1}{2} \left (i c+\frac {\pi }{2}\right )+\frac {i d x}{2}\right ) \, dx}{2 a}-\frac {f \int \log \left (1-e^{c+d x}\right ) \, dx}{a d}+\frac {f \int \log \left (1+e^{c+d x}\right ) \, dx}{a d}\\ &=-\frac {2 (e+f x) \tanh ^{-1}\left (e^{c+d x}\right )}{a d}-\frac {i (e+f x) \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {f \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{c+d x}\right )}{a d^2}+\frac {f \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{c+d x}\right )}{a d^2}+\frac {(i f) \int \coth \left (\frac {c}{2}-\frac {i \pi }{4}+\frac {d x}{2}\right ) \, dx}{a d}\\ &=-\frac {2 (e+f x) \tanh ^{-1}\left (e^{c+d x}\right )}{a d}+\frac {2 i f \log \left (\cosh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )\right )}{a d^2}-\frac {f \text {Li}_2\left (-e^{c+d x}\right )}{a d^2}+\frac {f \text {Li}_2\left (e^{c+d x}\right )}{a d^2}-\frac {i (e+f x) \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(345\) vs. \(2(126)=252\).
time = 0.79, size = 345, normalized size = 2.74 \begin {gather*} \frac {\left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right ) \left (f (c+d x) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )-2 f \text {ArcTan}\left (\tanh \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )+i f \log (\cosh (c+d x)) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )+d e \log \left (\tanh \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )-c f \log \left (\tanh \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )+f \left ((c+d x) \left (\log \left (1-e^{-c-d x}\right )-\log \left (1+e^{-c-d x}\right )\right )+\text {PolyLog}\left (2,-e^{-c-d x}\right )-\text {PolyLog}\left (2,e^{-c-d x}\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )-2 i d (e+f x) \sinh \left (\frac {1}{2} (c+d x)\right )\right )}{d^2 (a+i a \sinh (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 3.03, size = 211, normalized size = 1.67
method | result | size |
risch | \(\frac {2 f x +2 e}{d a \left ({\mathrm e}^{d x +c}-i\right )}-\frac {2 i f \ln \left ({\mathrm e}^{d x +c}\right )}{a \,d^{2}}+\frac {f \polylog \left (2, {\mathrm e}^{d x +c}\right )}{a \,d^{2}}-\frac {f \polylog \left (2, -{\mathrm e}^{d x +c}\right )}{a \,d^{2}}-\frac {e \ln \left ({\mathrm e}^{d x +c}+1\right )}{a d}-\frac {\ln \left ({\mathrm e}^{d x +c}+1\right ) f x}{a d}+\frac {\ln \left (1-{\mathrm e}^{d x +c}\right ) f x}{a d}+\frac {\ln \left (1-{\mathrm e}^{d x +c}\right ) c f}{a \,d^{2}}+\frac {2 i f \ln \left ({\mathrm e}^{d x +c}-i\right )}{a \,d^{2}}-\frac {f c \ln \left ({\mathrm e}^{d x +c}-1\right )}{a \,d^{2}}+\frac {e \ln \left ({\mathrm e}^{d x +c}-1\right )}{a d}\) | \(211\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 217 vs. \(2 (106) = 212\).
time = 0.40, size = 217, normalized size = 1.72 \begin {gather*} \frac {-2 i \, d f x e^{\left (d x + c\right )} - {\left (f e^{\left (d x + c\right )} - i \, f\right )} {\rm Li}_2\left (-e^{\left (d x + c\right )}\right ) + {\left (f e^{\left (d x + c\right )} - i \, f\right )} {\rm Li}_2\left (e^{\left (d x + c\right )}\right ) + 2 \, d e + {\left (i \, d f x + i \, d e - {\left (d f x + d e\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} + 1\right ) - 2 \, {\left (-i \, f e^{\left (d x + c\right )} - f\right )} \log \left (e^{\left (d x + c\right )} - i\right ) + {\left (i \, c f - i \, d e - {\left (c f - d e\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} - 1\right ) + {\left (-i \, d f x - i \, c f + {\left (d f x + c f\right )} e^{\left (d x + c\right )}\right )} \log \left (-e^{\left (d x + c\right )} + 1\right )}{a d^{2} e^{\left (d x + c\right )} - i \, a d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \left (\int \frac {e \operatorname {csch}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {f x \operatorname {csch}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {e+f\,x}{\mathrm {sinh}\left (c+d\,x\right )\,\left (a+a\,\mathrm {sinh}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________